
_test1:     file format elf32-i386


Disassembly of section .text:

00000000 <handler>:
#include "signal.h"

void handler();

void handler()
{
   0:	55                   	push   %ebp
   1:	89 e5                	mov    %esp,%ebp
   3:	83 ec 18             	sub    $0x18,%esp
        printf(1,"\nMY OWN HANDLER!!!!! \n");
   6:	c7 44 24 04 86 0f 00 	movl   $0xf86,0x4(%esp)
   d:	00 
   e:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  15:	e8 1b 05 00 00       	call   535 <printf>
}
  1a:	c9                   	leave  
  1b:	c3                   	ret    

0000001c <main>:

int main(void)
{
  1c:	55                   	push   %ebp
  1d:	89 e5                	mov    %esp,%ebp
  1f:	83 e4 f0             	and    $0xfffffff0,%esp
  22:	83 ec 20             	sub    $0x20,%esp
  int ticks = 1000;
  25:	c7 44 24 18 e8 03 00 	movl   $0x3e8,0x18(%esp)
  2c:	00 
  int i;
  alarm(ticks);
  2d:	8b 44 24 18          	mov    0x18(%esp),%eax
  31:	89 04 24             	mov    %eax,(%esp)
  34:	e8 0f 04 00 00       	call   448 <alarm>
  ticks = 3;
  39:	c7 44 24 18 03 00 00 	movl   $0x3,0x18(%esp)
  40:	00 
  alarm(ticks);
  41:	8b 44 24 18          	mov    0x18(%esp),%eax
  45:	89 04 24             	mov    %eax,(%esp)
  48:	e8 fb 03 00 00       	call   448 <alarm>
  for(i=0;i<50;i++)
  4d:	c7 44 24 1c 00 00 00 	movl   $0x0,0x1c(%esp)
  54:	00 
  55:	eb 21                	jmp    78 <main+0x5c>
  {
        printf(1,"child %d FINISHED CALC! \n",i);
  57:	8b 44 24 1c          	mov    0x1c(%esp),%eax
  5b:	89 44 24 08          	mov    %eax,0x8(%esp)
  5f:	c7 44 24 04 9d 0f 00 	movl   $0xf9d,0x4(%esp)
  66:	00 
  67:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  6e:	e8 c2 04 00 00       	call   535 <printf>
  int ticks = 1000;
  int i;
  alarm(ticks);
  ticks = 3;
  alarm(ticks);
  for(i=0;i<50;i++)
  73:	83 44 24 1c 01       	addl   $0x1,0x1c(%esp)
  78:	83 7c 24 1c 31       	cmpl   $0x31,0x1c(%esp)
  7d:	7e d8                	jle    57 <main+0x3b>
  {
        printf(1,"child %d FINISHED CALC! \n",i);
  }
  alarm(ticks);
  7f:	8b 44 24 18          	mov    0x18(%esp),%eax
  83:	89 04 24             	mov    %eax,(%esp)
  86:	e8 bd 03 00 00       	call   448 <alarm>
  sighandler_t h = (sighandler_t)handler;
  8b:	c7 44 24 14 00 00 00 	movl   $0x0,0x14(%esp)
  92:	00 
  signal(SIGALRM,h);
  93:	8b 44 24 14          	mov    0x14(%esp),%eax
  97:	89 44 24 04          	mov    %eax,0x4(%esp)
  9b:	c7 04 24 0e 00 00 00 	movl   $0xe,(%esp)
  a2:	e8 91 03 00 00       	call   438 <signal>
  for(i=0;i<50;i++)
  a7:	c7 44 24 1c 00 00 00 	movl   $0x0,0x1c(%esp)
  ae:	00 
  af:	eb 21                	jmp    d2 <main+0xb6>
  {
        printf(1,"child %d FINISHED CALC! \n",i);
  b1:	8b 44 24 1c          	mov    0x1c(%esp),%eax
  b5:	89 44 24 08          	mov    %eax,0x8(%esp)
  b9:	c7 44 24 04 9d 0f 00 	movl   $0xf9d,0x4(%esp)
  c0:	00 
  c1:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  c8:	e8 68 04 00 00       	call   535 <printf>
        printf(1,"child %d FINISHED CALC! \n",i);
  }
  alarm(ticks);
  sighandler_t h = (sighandler_t)handler;
  signal(SIGALRM,h);
  for(i=0;i<50;i++)
  cd:	83 44 24 1c 01       	addl   $0x1,0x1c(%esp)
  d2:	83 7c 24 1c 31       	cmpl   $0x31,0x1c(%esp)
  d7:	7e d8                	jle    b1 <main+0x95>
  {
        printf(1,"child %d FINISHED CALC! \n",i);
  }

  alarm(1);
  d9:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  e0:	e8 63 03 00 00       	call   448 <alarm>
  for(i=0;i<50;i++)
  e5:	c7 44 24 1c 00 00 00 	movl   $0x0,0x1c(%esp)
  ec:	00 
  ed:	eb 34                	jmp    123 <main+0x107>
  {
        printf(1,"child %d FINISHED CALC! \n",i);
  ef:	8b 44 24 1c          	mov    0x1c(%esp),%eax
  f3:	89 44 24 08          	mov    %eax,0x8(%esp)
  f7:	c7 44 24 04 9d 0f 00 	movl   $0xf9d,0x4(%esp)
  fe:	00 
  ff:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
 106:	e8 2a 04 00 00       	call   535 <printf>
        if(i==0)
 10b:	83 7c 24 1c 00       	cmpl   $0x0,0x1c(%esp)
 110:	75 0c                	jne    11e <main+0x102>
          alarm(0);
 112:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 119:	e8 2a 03 00 00       	call   448 <alarm>
  {
        printf(1,"child %d FINISHED CALC! \n",i);
  }

  alarm(1);
  for(i=0;i<50;i++)
 11e:	83 44 24 1c 01       	addl   $0x1,0x1c(%esp)
 123:	83 7c 24 1c 31       	cmpl   $0x31,0x1c(%esp)
 128:	7e c5                	jle    ef <main+0xd3>
        printf(1,"child %d FINISHED CALC! \n",i);
        if(i==0)
          alarm(0);
  }

  exit();
 12a:	e8 69 02 00 00       	call   398 <exit>
 12f:	90                   	nop

00000130 <stosb>:
               "cc");
}

static inline void
stosb(void *addr, int data, int cnt)
{
 130:	55                   	push   %ebp
 131:	89 e5                	mov    %esp,%ebp
 133:	57                   	push   %edi
 134:	53                   	push   %ebx
  asm volatile("cld; rep stosb" :
 135:	8b 4d 08             	mov    0x8(%ebp),%ecx
 138:	8b 55 10             	mov    0x10(%ebp),%edx
 13b:	8b 45 0c             	mov    0xc(%ebp),%eax
 13e:	89 cb                	mov    %ecx,%ebx
 140:	89 df                	mov    %ebx,%edi
 142:	89 d1                	mov    %edx,%ecx
 144:	fc                   	cld    
 145:	f3 aa                	rep stos %al,%es:(%edi)
 147:	89 ca                	mov    %ecx,%edx
 149:	89 fb                	mov    %edi,%ebx
 14b:	89 5d 08             	mov    %ebx,0x8(%ebp)
 14e:	89 55 10             	mov    %edx,0x10(%ebp)
               "=D" (addr), "=c" (cnt) :
               "0" (addr), "1" (cnt), "a" (data) :
               "memory", "cc");
}
 151:	5b                   	pop    %ebx
 152:	5f                   	pop    %edi
 153:	5d                   	pop    %ebp
 154:	c3                   	ret    

00000155 <strcpy>:
#include "user.h"
#include "x86.h"

char*
strcpy(char *s, char *t)
{
 155:	55                   	push   %ebp
 156:	89 e5                	mov    %esp,%ebp
 158:	83 ec 10             	sub    $0x10,%esp
  char *os;

  os = s;
 15b:	8b 45 08             	mov    0x8(%ebp),%eax
 15e:	89 45 fc             	mov    %eax,-0x4(%ebp)
  while((*s++ = *t++) != 0)
 161:	90                   	nop
 162:	8b 45 0c             	mov    0xc(%ebp),%eax
 165:	0f b6 10             	movzbl (%eax),%edx
 168:	8b 45 08             	mov    0x8(%ebp),%eax
 16b:	88 10                	mov    %dl,(%eax)
 16d:	8b 45 08             	mov    0x8(%ebp),%eax
 170:	0f b6 00             	movzbl (%eax),%eax
 173:	84 c0                	test   %al,%al
 175:	0f 95 c0             	setne  %al
 178:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 17c:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
 180:	84 c0                	test   %al,%al
 182:	75 de                	jne    162 <strcpy+0xd>
    ;
  return os;
 184:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 187:	c9                   	leave  
 188:	c3                   	ret    

00000189 <strcmp>:

int
strcmp(const char *p, const char *q)
{
 189:	55                   	push   %ebp
 18a:	89 e5                	mov    %esp,%ebp
  while(*p && *p == *q)
 18c:	eb 08                	jmp    196 <strcmp+0xd>
    p++, q++;
 18e:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 192:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
}

int
strcmp(const char *p, const char *q)
{
  while(*p && *p == *q)
 196:	8b 45 08             	mov    0x8(%ebp),%eax
 199:	0f b6 00             	movzbl (%eax),%eax
 19c:	84 c0                	test   %al,%al
 19e:	74 10                	je     1b0 <strcmp+0x27>
 1a0:	8b 45 08             	mov    0x8(%ebp),%eax
 1a3:	0f b6 10             	movzbl (%eax),%edx
 1a6:	8b 45 0c             	mov    0xc(%ebp),%eax
 1a9:	0f b6 00             	movzbl (%eax),%eax
 1ac:	38 c2                	cmp    %al,%dl
 1ae:	74 de                	je     18e <strcmp+0x5>
    p++, q++;
  return (uchar)*p - (uchar)*q;
 1b0:	8b 45 08             	mov    0x8(%ebp),%eax
 1b3:	0f b6 00             	movzbl (%eax),%eax
 1b6:	0f b6 d0             	movzbl %al,%edx
 1b9:	8b 45 0c             	mov    0xc(%ebp),%eax
 1bc:	0f b6 00             	movzbl (%eax),%eax
 1bf:	0f b6 c0             	movzbl %al,%eax
 1c2:	89 d1                	mov    %edx,%ecx
 1c4:	29 c1                	sub    %eax,%ecx
 1c6:	89 c8                	mov    %ecx,%eax
}
 1c8:	5d                   	pop    %ebp
 1c9:	c3                   	ret    

000001ca <strlen>:

uint
strlen(char *s)
{
 1ca:	55                   	push   %ebp
 1cb:	89 e5                	mov    %esp,%ebp
 1cd:	83 ec 10             	sub    $0x10,%esp
  int n;

  for(n = 0; s[n]; n++)
 1d0:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
 1d7:	eb 04                	jmp    1dd <strlen+0x13>
 1d9:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 1dd:	8b 55 fc             	mov    -0x4(%ebp),%edx
 1e0:	8b 45 08             	mov    0x8(%ebp),%eax
 1e3:	01 d0                	add    %edx,%eax
 1e5:	0f b6 00             	movzbl (%eax),%eax
 1e8:	84 c0                	test   %al,%al
 1ea:	75 ed                	jne    1d9 <strlen+0xf>
    ;
  return n;
 1ec:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 1ef:	c9                   	leave  
 1f0:	c3                   	ret    

000001f1 <memset>:

void*
memset(void *dst, int c, uint n)
{
 1f1:	55                   	push   %ebp
 1f2:	89 e5                	mov    %esp,%ebp
 1f4:	83 ec 0c             	sub    $0xc,%esp
  stosb(dst, c, n);
 1f7:	8b 45 10             	mov    0x10(%ebp),%eax
 1fa:	89 44 24 08          	mov    %eax,0x8(%esp)
 1fe:	8b 45 0c             	mov    0xc(%ebp),%eax
 201:	89 44 24 04          	mov    %eax,0x4(%esp)
 205:	8b 45 08             	mov    0x8(%ebp),%eax
 208:	89 04 24             	mov    %eax,(%esp)
 20b:	e8 20 ff ff ff       	call   130 <stosb>
  return dst;
 210:	8b 45 08             	mov    0x8(%ebp),%eax
}
 213:	c9                   	leave  
 214:	c3                   	ret    

00000215 <strchr>:

char*
strchr(const char *s, char c)
{
 215:	55                   	push   %ebp
 216:	89 e5                	mov    %esp,%ebp
 218:	83 ec 04             	sub    $0x4,%esp
 21b:	8b 45 0c             	mov    0xc(%ebp),%eax
 21e:	88 45 fc             	mov    %al,-0x4(%ebp)
  for(; *s; s++)
 221:	eb 14                	jmp    237 <strchr+0x22>
    if(*s == c)
 223:	8b 45 08             	mov    0x8(%ebp),%eax
 226:	0f b6 00             	movzbl (%eax),%eax
 229:	3a 45 fc             	cmp    -0x4(%ebp),%al
 22c:	75 05                	jne    233 <strchr+0x1e>
      return (char*)s;
 22e:	8b 45 08             	mov    0x8(%ebp),%eax
 231:	eb 13                	jmp    246 <strchr+0x31>
}

char*
strchr(const char *s, char c)
{
  for(; *s; s++)
 233:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 237:	8b 45 08             	mov    0x8(%ebp),%eax
 23a:	0f b6 00             	movzbl (%eax),%eax
 23d:	84 c0                	test   %al,%al
 23f:	75 e2                	jne    223 <strchr+0xe>
    if(*s == c)
      return (char*)s;
  return 0;
 241:	b8 00 00 00 00       	mov    $0x0,%eax
}
 246:	c9                   	leave  
 247:	c3                   	ret    

00000248 <gets>:

char*
gets(char *buf, int max)
{
 248:	55                   	push   %ebp
 249:	89 e5                	mov    %esp,%ebp
 24b:	83 ec 28             	sub    $0x28,%esp
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 24e:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
 255:	eb 46                	jmp    29d <gets+0x55>
    cc = read(0, &c, 1);
 257:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
 25e:	00 
 25f:	8d 45 ef             	lea    -0x11(%ebp),%eax
 262:	89 44 24 04          	mov    %eax,0x4(%esp)
 266:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 26d:	e8 3e 01 00 00       	call   3b0 <read>
 272:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if(cc < 1)
 275:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 279:	7e 2f                	jle    2aa <gets+0x62>
      break;
    buf[i++] = c;
 27b:	8b 55 f4             	mov    -0xc(%ebp),%edx
 27e:	8b 45 08             	mov    0x8(%ebp),%eax
 281:	01 c2                	add    %eax,%edx
 283:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 287:	88 02                	mov    %al,(%edx)
 289:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
    if(c == '\n' || c == '\r')
 28d:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 291:	3c 0a                	cmp    $0xa,%al
 293:	74 16                	je     2ab <gets+0x63>
 295:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 299:	3c 0d                	cmp    $0xd,%al
 29b:	74 0e                	je     2ab <gets+0x63>
gets(char *buf, int max)
{
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 29d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 2a0:	83 c0 01             	add    $0x1,%eax
 2a3:	3b 45 0c             	cmp    0xc(%ebp),%eax
 2a6:	7c af                	jl     257 <gets+0xf>
 2a8:	eb 01                	jmp    2ab <gets+0x63>
    cc = read(0, &c, 1);
    if(cc < 1)
      break;
 2aa:	90                   	nop
    buf[i++] = c;
    if(c == '\n' || c == '\r')
      break;
  }
  buf[i] = '\0';
 2ab:	8b 55 f4             	mov    -0xc(%ebp),%edx
 2ae:	8b 45 08             	mov    0x8(%ebp),%eax
 2b1:	01 d0                	add    %edx,%eax
 2b3:	c6 00 00             	movb   $0x0,(%eax)
  return buf;
 2b6:	8b 45 08             	mov    0x8(%ebp),%eax
}
 2b9:	c9                   	leave  
 2ba:	c3                   	ret    

000002bb <stat>:

int
stat(char *n, struct stat *st)
{
 2bb:	55                   	push   %ebp
 2bc:	89 e5                	mov    %esp,%ebp
 2be:	83 ec 28             	sub    $0x28,%esp
  int fd;
  int r;

  fd = open(n, O_RDONLY);
 2c1:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
 2c8:	00 
 2c9:	8b 45 08             	mov    0x8(%ebp),%eax
 2cc:	89 04 24             	mov    %eax,(%esp)
 2cf:	e8 04 01 00 00       	call   3d8 <open>
 2d4:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(fd < 0)
 2d7:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 2db:	79 07                	jns    2e4 <stat+0x29>
    return -1;
 2dd:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
 2e2:	eb 23                	jmp    307 <stat+0x4c>
  r = fstat(fd, st);
 2e4:	8b 45 0c             	mov    0xc(%ebp),%eax
 2e7:	89 44 24 04          	mov    %eax,0x4(%esp)
 2eb:	8b 45 f4             	mov    -0xc(%ebp),%eax
 2ee:	89 04 24             	mov    %eax,(%esp)
 2f1:	e8 fa 00 00 00       	call   3f0 <fstat>
 2f6:	89 45 f0             	mov    %eax,-0x10(%ebp)
  close(fd);
 2f9:	8b 45 f4             	mov    -0xc(%ebp),%eax
 2fc:	89 04 24             	mov    %eax,(%esp)
 2ff:	e8 bc 00 00 00       	call   3c0 <close>
  return r;
 304:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
 307:	c9                   	leave  
 308:	c3                   	ret    

00000309 <atoi>:

int
atoi(const char *s)
{
 309:	55                   	push   %ebp
 30a:	89 e5                	mov    %esp,%ebp
 30c:	83 ec 10             	sub    $0x10,%esp
  int n;

  n = 0;
 30f:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  while('0' <= *s && *s <= '9')
 316:	eb 23                	jmp    33b <atoi+0x32>
    n = n*10 + *s++ - '0';
 318:	8b 55 fc             	mov    -0x4(%ebp),%edx
 31b:	89 d0                	mov    %edx,%eax
 31d:	c1 e0 02             	shl    $0x2,%eax
 320:	01 d0                	add    %edx,%eax
 322:	01 c0                	add    %eax,%eax
 324:	89 c2                	mov    %eax,%edx
 326:	8b 45 08             	mov    0x8(%ebp),%eax
 329:	0f b6 00             	movzbl (%eax),%eax
 32c:	0f be c0             	movsbl %al,%eax
 32f:	01 d0                	add    %edx,%eax
 331:	83 e8 30             	sub    $0x30,%eax
 334:	89 45 fc             	mov    %eax,-0x4(%ebp)
 337:	83 45 08 01          	addl   $0x1,0x8(%ebp)
atoi(const char *s)
{
  int n;

  n = 0;
  while('0' <= *s && *s <= '9')
 33b:	8b 45 08             	mov    0x8(%ebp),%eax
 33e:	0f b6 00             	movzbl (%eax),%eax
 341:	3c 2f                	cmp    $0x2f,%al
 343:	7e 0a                	jle    34f <atoi+0x46>
 345:	8b 45 08             	mov    0x8(%ebp),%eax
 348:	0f b6 00             	movzbl (%eax),%eax
 34b:	3c 39                	cmp    $0x39,%al
 34d:	7e c9                	jle    318 <atoi+0xf>
    n = n*10 + *s++ - '0';
  return n;
 34f:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 352:	c9                   	leave  
 353:	c3                   	ret    

00000354 <memmove>:

void*
memmove(void *vdst, void *vsrc, int n)
{
 354:	55                   	push   %ebp
 355:	89 e5                	mov    %esp,%ebp
 357:	83 ec 10             	sub    $0x10,%esp
  char *dst, *src;
  
  dst = vdst;
 35a:	8b 45 08             	mov    0x8(%ebp),%eax
 35d:	89 45 fc             	mov    %eax,-0x4(%ebp)
  src = vsrc;
 360:	8b 45 0c             	mov    0xc(%ebp),%eax
 363:	89 45 f8             	mov    %eax,-0x8(%ebp)
  while(n-- > 0)
 366:	eb 13                	jmp    37b <memmove+0x27>
    *dst++ = *src++;
 368:	8b 45 f8             	mov    -0x8(%ebp),%eax
 36b:	0f b6 10             	movzbl (%eax),%edx
 36e:	8b 45 fc             	mov    -0x4(%ebp),%eax
 371:	88 10                	mov    %dl,(%eax)
 373:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 377:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
{
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
 37b:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
 37f:	0f 9f c0             	setg   %al
 382:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
 386:	84 c0                	test   %al,%al
 388:	75 de                	jne    368 <memmove+0x14>
    *dst++ = *src++;
  return vdst;
 38a:	8b 45 08             	mov    0x8(%ebp),%eax
}
 38d:	c9                   	leave  
 38e:	c3                   	ret    
 38f:	90                   	nop

00000390 <fork>:
  name: \
    movl $SYS_ ## name, %eax; \
    int $T_SYSCALL; \
    ret

SYSCALL(fork)
 390:	b8 01 00 00 00       	mov    $0x1,%eax
 395:	cd 40                	int    $0x40
 397:	c3                   	ret    

00000398 <exit>:
SYSCALL(exit)
 398:	b8 02 00 00 00       	mov    $0x2,%eax
 39d:	cd 40                	int    $0x40
 39f:	c3                   	ret    

000003a0 <wait>:
SYSCALL(wait)
 3a0:	b8 03 00 00 00       	mov    $0x3,%eax
 3a5:	cd 40                	int    $0x40
 3a7:	c3                   	ret    

000003a8 <pipe>:
SYSCALL(pipe)
 3a8:	b8 04 00 00 00       	mov    $0x4,%eax
 3ad:	cd 40                	int    $0x40
 3af:	c3                   	ret    

000003b0 <read>:
SYSCALL(read)
 3b0:	b8 05 00 00 00       	mov    $0x5,%eax
 3b5:	cd 40                	int    $0x40
 3b7:	c3                   	ret    

000003b8 <write>:
SYSCALL(write)
 3b8:	b8 10 00 00 00       	mov    $0x10,%eax
 3bd:	cd 40                	int    $0x40
 3bf:	c3                   	ret    

000003c0 <close>:
SYSCALL(close)
 3c0:	b8 15 00 00 00       	mov    $0x15,%eax
 3c5:	cd 40                	int    $0x40
 3c7:	c3                   	ret    

000003c8 <kill>:
SYSCALL(kill)
 3c8:	b8 06 00 00 00       	mov    $0x6,%eax
 3cd:	cd 40                	int    $0x40
 3cf:	c3                   	ret    

000003d0 <exec>:
SYSCALL(exec)
 3d0:	b8 07 00 00 00       	mov    $0x7,%eax
 3d5:	cd 40                	int    $0x40
 3d7:	c3                   	ret    

000003d8 <open>:
SYSCALL(open)
 3d8:	b8 0f 00 00 00       	mov    $0xf,%eax
 3dd:	cd 40                	int    $0x40
 3df:	c3                   	ret    

000003e0 <mknod>:
SYSCALL(mknod)
 3e0:	b8 11 00 00 00       	mov    $0x11,%eax
 3e5:	cd 40                	int    $0x40
 3e7:	c3                   	ret    

000003e8 <unlink>:
SYSCALL(unlink)
 3e8:	b8 12 00 00 00       	mov    $0x12,%eax
 3ed:	cd 40                	int    $0x40
 3ef:	c3                   	ret    

000003f0 <fstat>:
SYSCALL(fstat)
 3f0:	b8 08 00 00 00       	mov    $0x8,%eax
 3f5:	cd 40                	int    $0x40
 3f7:	c3                   	ret    

000003f8 <link>:
SYSCALL(link)
 3f8:	b8 13 00 00 00       	mov    $0x13,%eax
 3fd:	cd 40                	int    $0x40
 3ff:	c3                   	ret    

00000400 <mkdir>:
SYSCALL(mkdir)
 400:	b8 14 00 00 00       	mov    $0x14,%eax
 405:	cd 40                	int    $0x40
 407:	c3                   	ret    

00000408 <chdir>:
SYSCALL(chdir)
 408:	b8 09 00 00 00       	mov    $0x9,%eax
 40d:	cd 40                	int    $0x40
 40f:	c3                   	ret    

00000410 <dup>:
SYSCALL(dup)
 410:	b8 0a 00 00 00       	mov    $0xa,%eax
 415:	cd 40                	int    $0x40
 417:	c3                   	ret    

00000418 <getpid>:
SYSCALL(getpid)
 418:	b8 0b 00 00 00       	mov    $0xb,%eax
 41d:	cd 40                	int    $0x40
 41f:	c3                   	ret    

00000420 <sbrk>:
SYSCALL(sbrk)
 420:	b8 0c 00 00 00       	mov    $0xc,%eax
 425:	cd 40                	int    $0x40
 427:	c3                   	ret    

00000428 <sleep>:
SYSCALL(sleep)
 428:	b8 0d 00 00 00       	mov    $0xd,%eax
 42d:	cd 40                	int    $0x40
 42f:	c3                   	ret    

00000430 <uptime>:
SYSCALL(uptime)
 430:	b8 0e 00 00 00       	mov    $0xe,%eax
 435:	cd 40                	int    $0x40
 437:	c3                   	ret    

00000438 <signal>:

//our addition
SYSCALL(signal)
 438:	b8 1f 00 00 00       	mov    $0x1f,%eax
 43d:	cd 40                	int    $0x40
 43f:	c3                   	ret    

00000440 <sigsend>:
SYSCALL(sigsend)
 440:	b8 20 00 00 00       	mov    $0x20,%eax
 445:	cd 40                	int    $0x40
 447:	c3                   	ret    

00000448 <alarm>:
SYSCALL(alarm)
 448:	b8 21 00 00 00       	mov    $0x21,%eax
 44d:	cd 40                	int    $0x40
 44f:	c3                   	ret    

00000450 <getTicks>:
SYSCALL(getTicks)
 450:	b8 22 00 00 00       	mov    $0x22,%eax
 455:	cd 40                	int    $0x40
 457:	c3                   	ret    

00000458 <putc>:
#include "stat.h"
#include "user.h"

static void
putc(int fd, char c)
{
 458:	55                   	push   %ebp
 459:	89 e5                	mov    %esp,%ebp
 45b:	83 ec 28             	sub    $0x28,%esp
 45e:	8b 45 0c             	mov    0xc(%ebp),%eax
 461:	88 45 f4             	mov    %al,-0xc(%ebp)
  write(fd, &c, 1);
 464:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
 46b:	00 
 46c:	8d 45 f4             	lea    -0xc(%ebp),%eax
 46f:	89 44 24 04          	mov    %eax,0x4(%esp)
 473:	8b 45 08             	mov    0x8(%ebp),%eax
 476:	89 04 24             	mov    %eax,(%esp)
 479:	e8 3a ff ff ff       	call   3b8 <write>
}
 47e:	c9                   	leave  
 47f:	c3                   	ret    

00000480 <printint>:

static void
printint(int fd, int xx, int base, int sgn)
{
 480:	55                   	push   %ebp
 481:	89 e5                	mov    %esp,%ebp
 483:	83 ec 48             	sub    $0x48,%esp
  static char digits[] = "0123456789ABCDEF";
  char buf[16];
  int i, neg;
  uint x;

  neg = 0;
 486:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  if(sgn && xx < 0){
 48d:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
 491:	74 17                	je     4aa <printint+0x2a>
 493:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
 497:	79 11                	jns    4aa <printint+0x2a>
    neg = 1;
 499:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
    x = -xx;
 4a0:	8b 45 0c             	mov    0xc(%ebp),%eax
 4a3:	f7 d8                	neg    %eax
 4a5:	89 45 ec             	mov    %eax,-0x14(%ebp)
 4a8:	eb 06                	jmp    4b0 <printint+0x30>
  } else {
    x = xx;
 4aa:	8b 45 0c             	mov    0xc(%ebp),%eax
 4ad:	89 45 ec             	mov    %eax,-0x14(%ebp)
  }

  i = 0;
 4b0:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  do{
    buf[i++] = digits[x % base];
 4b7:	8b 4d 10             	mov    0x10(%ebp),%ecx
 4ba:	8b 45 ec             	mov    -0x14(%ebp),%eax
 4bd:	ba 00 00 00 00       	mov    $0x0,%edx
 4c2:	f7 f1                	div    %ecx
 4c4:	89 d0                	mov    %edx,%eax
 4c6:	0f b6 80 34 14 00 00 	movzbl 0x1434(%eax),%eax
 4cd:	8d 4d dc             	lea    -0x24(%ebp),%ecx
 4d0:	8b 55 f4             	mov    -0xc(%ebp),%edx
 4d3:	01 ca                	add    %ecx,%edx
 4d5:	88 02                	mov    %al,(%edx)
 4d7:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  }while((x /= base) != 0);
 4db:	8b 55 10             	mov    0x10(%ebp),%edx
 4de:	89 55 d4             	mov    %edx,-0x2c(%ebp)
 4e1:	8b 45 ec             	mov    -0x14(%ebp),%eax
 4e4:	ba 00 00 00 00       	mov    $0x0,%edx
 4e9:	f7 75 d4             	divl   -0x2c(%ebp)
 4ec:	89 45 ec             	mov    %eax,-0x14(%ebp)
 4ef:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 4f3:	75 c2                	jne    4b7 <printint+0x37>
  if(neg)
 4f5:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 4f9:	74 2e                	je     529 <printint+0xa9>
    buf[i++] = '-';
 4fb:	8d 55 dc             	lea    -0x24(%ebp),%edx
 4fe:	8b 45 f4             	mov    -0xc(%ebp),%eax
 501:	01 d0                	add    %edx,%eax
 503:	c6 00 2d             	movb   $0x2d,(%eax)
 506:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)

  while(--i >= 0)
 50a:	eb 1d                	jmp    529 <printint+0xa9>
    putc(fd, buf[i]);
 50c:	8d 55 dc             	lea    -0x24(%ebp),%edx
 50f:	8b 45 f4             	mov    -0xc(%ebp),%eax
 512:	01 d0                	add    %edx,%eax
 514:	0f b6 00             	movzbl (%eax),%eax
 517:	0f be c0             	movsbl %al,%eax
 51a:	89 44 24 04          	mov    %eax,0x4(%esp)
 51e:	8b 45 08             	mov    0x8(%ebp),%eax
 521:	89 04 24             	mov    %eax,(%esp)
 524:	e8 2f ff ff ff       	call   458 <putc>
    buf[i++] = digits[x % base];
  }while((x /= base) != 0);
  if(neg)
    buf[i++] = '-';

  while(--i >= 0)
 529:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
 52d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 531:	79 d9                	jns    50c <printint+0x8c>
    putc(fd, buf[i]);
}
 533:	c9                   	leave  
 534:	c3                   	ret    

00000535 <printf>:

// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
 535:	55                   	push   %ebp
 536:	89 e5                	mov    %esp,%ebp
 538:	83 ec 38             	sub    $0x38,%esp
  char *s;
  int c, i, state;
  uint *ap;

  state = 0;
 53b:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  ap = (uint*)(void*)&fmt + 1;
 542:	8d 45 0c             	lea    0xc(%ebp),%eax
 545:	83 c0 04             	add    $0x4,%eax
 548:	89 45 e8             	mov    %eax,-0x18(%ebp)
  for(i = 0; fmt[i]; i++){
 54b:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
 552:	e9 7d 01 00 00       	jmp    6d4 <printf+0x19f>
    c = fmt[i] & 0xff;
 557:	8b 55 0c             	mov    0xc(%ebp),%edx
 55a:	8b 45 f0             	mov    -0x10(%ebp),%eax
 55d:	01 d0                	add    %edx,%eax
 55f:	0f b6 00             	movzbl (%eax),%eax
 562:	0f be c0             	movsbl %al,%eax
 565:	25 ff 00 00 00       	and    $0xff,%eax
 56a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(state == 0){
 56d:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 571:	75 2c                	jne    59f <printf+0x6a>
      if(c == '%'){
 573:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 577:	75 0c                	jne    585 <printf+0x50>
        state = '%';
 579:	c7 45 ec 25 00 00 00 	movl   $0x25,-0x14(%ebp)
 580:	e9 4b 01 00 00       	jmp    6d0 <printf+0x19b>
      } else {
        putc(fd, c);
 585:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 588:	0f be c0             	movsbl %al,%eax
 58b:	89 44 24 04          	mov    %eax,0x4(%esp)
 58f:	8b 45 08             	mov    0x8(%ebp),%eax
 592:	89 04 24             	mov    %eax,(%esp)
 595:	e8 be fe ff ff       	call   458 <putc>
 59a:	e9 31 01 00 00       	jmp    6d0 <printf+0x19b>
      }
    } else if(state == '%'){
 59f:	83 7d ec 25          	cmpl   $0x25,-0x14(%ebp)
 5a3:	0f 85 27 01 00 00    	jne    6d0 <printf+0x19b>
      if(c == 'd'){
 5a9:	83 7d e4 64          	cmpl   $0x64,-0x1c(%ebp)
 5ad:	75 2d                	jne    5dc <printf+0xa7>
        printint(fd, *ap, 10, 1);
 5af:	8b 45 e8             	mov    -0x18(%ebp),%eax
 5b2:	8b 00                	mov    (%eax),%eax
 5b4:	c7 44 24 0c 01 00 00 	movl   $0x1,0xc(%esp)
 5bb:	00 
 5bc:	c7 44 24 08 0a 00 00 	movl   $0xa,0x8(%esp)
 5c3:	00 
 5c4:	89 44 24 04          	mov    %eax,0x4(%esp)
 5c8:	8b 45 08             	mov    0x8(%ebp),%eax
 5cb:	89 04 24             	mov    %eax,(%esp)
 5ce:	e8 ad fe ff ff       	call   480 <printint>
        ap++;
 5d3:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 5d7:	e9 ed 00 00 00       	jmp    6c9 <printf+0x194>
      } else if(c == 'x' || c == 'p'){
 5dc:	83 7d e4 78          	cmpl   $0x78,-0x1c(%ebp)
 5e0:	74 06                	je     5e8 <printf+0xb3>
 5e2:	83 7d e4 70          	cmpl   $0x70,-0x1c(%ebp)
 5e6:	75 2d                	jne    615 <printf+0xe0>
        printint(fd, *ap, 16, 0);
 5e8:	8b 45 e8             	mov    -0x18(%ebp),%eax
 5eb:	8b 00                	mov    (%eax),%eax
 5ed:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
 5f4:	00 
 5f5:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
 5fc:	00 
 5fd:	89 44 24 04          	mov    %eax,0x4(%esp)
 601:	8b 45 08             	mov    0x8(%ebp),%eax
 604:	89 04 24             	mov    %eax,(%esp)
 607:	e8 74 fe ff ff       	call   480 <printint>
        ap++;
 60c:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 610:	e9 b4 00 00 00       	jmp    6c9 <printf+0x194>
      } else if(c == 's'){
 615:	83 7d e4 73          	cmpl   $0x73,-0x1c(%ebp)
 619:	75 46                	jne    661 <printf+0x12c>
        s = (char*)*ap;
 61b:	8b 45 e8             	mov    -0x18(%ebp),%eax
 61e:	8b 00                	mov    (%eax),%eax
 620:	89 45 f4             	mov    %eax,-0xc(%ebp)
        ap++;
 623:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
        if(s == 0)
 627:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 62b:	75 27                	jne    654 <printf+0x11f>
          s = "(null)";
 62d:	c7 45 f4 b7 0f 00 00 	movl   $0xfb7,-0xc(%ebp)
        while(*s != 0){
 634:	eb 1e                	jmp    654 <printf+0x11f>
          putc(fd, *s);
 636:	8b 45 f4             	mov    -0xc(%ebp),%eax
 639:	0f b6 00             	movzbl (%eax),%eax
 63c:	0f be c0             	movsbl %al,%eax
 63f:	89 44 24 04          	mov    %eax,0x4(%esp)
 643:	8b 45 08             	mov    0x8(%ebp),%eax
 646:	89 04 24             	mov    %eax,(%esp)
 649:	e8 0a fe ff ff       	call   458 <putc>
          s++;
 64e:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
 652:	eb 01                	jmp    655 <printf+0x120>
      } else if(c == 's'){
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
        while(*s != 0){
 654:	90                   	nop
 655:	8b 45 f4             	mov    -0xc(%ebp),%eax
 658:	0f b6 00             	movzbl (%eax),%eax
 65b:	84 c0                	test   %al,%al
 65d:	75 d7                	jne    636 <printf+0x101>
 65f:	eb 68                	jmp    6c9 <printf+0x194>
          putc(fd, *s);
          s++;
        }
      } else if(c == 'c'){
 661:	83 7d e4 63          	cmpl   $0x63,-0x1c(%ebp)
 665:	75 1d                	jne    684 <printf+0x14f>
        putc(fd, *ap);
 667:	8b 45 e8             	mov    -0x18(%ebp),%eax
 66a:	8b 00                	mov    (%eax),%eax
 66c:	0f be c0             	movsbl %al,%eax
 66f:	89 44 24 04          	mov    %eax,0x4(%esp)
 673:	8b 45 08             	mov    0x8(%ebp),%eax
 676:	89 04 24             	mov    %eax,(%esp)
 679:	e8 da fd ff ff       	call   458 <putc>
        ap++;
 67e:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 682:	eb 45                	jmp    6c9 <printf+0x194>
      } else if(c == '%'){
 684:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 688:	75 17                	jne    6a1 <printf+0x16c>
        putc(fd, c);
 68a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 68d:	0f be c0             	movsbl %al,%eax
 690:	89 44 24 04          	mov    %eax,0x4(%esp)
 694:	8b 45 08             	mov    0x8(%ebp),%eax
 697:	89 04 24             	mov    %eax,(%esp)
 69a:	e8 b9 fd ff ff       	call   458 <putc>
 69f:	eb 28                	jmp    6c9 <printf+0x194>
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
 6a1:	c7 44 24 04 25 00 00 	movl   $0x25,0x4(%esp)
 6a8:	00 
 6a9:	8b 45 08             	mov    0x8(%ebp),%eax
 6ac:	89 04 24             	mov    %eax,(%esp)
 6af:	e8 a4 fd ff ff       	call   458 <putc>
        putc(fd, c);
 6b4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 6b7:	0f be c0             	movsbl %al,%eax
 6ba:	89 44 24 04          	mov    %eax,0x4(%esp)
 6be:	8b 45 08             	mov    0x8(%ebp),%eax
 6c1:	89 04 24             	mov    %eax,(%esp)
 6c4:	e8 8f fd ff ff       	call   458 <putc>
      }
      state = 0;
 6c9:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  int c, i, state;
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
 6d0:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
 6d4:	8b 55 0c             	mov    0xc(%ebp),%edx
 6d7:	8b 45 f0             	mov    -0x10(%ebp),%eax
 6da:	01 d0                	add    %edx,%eax
 6dc:	0f b6 00             	movzbl (%eax),%eax
 6df:	84 c0                	test   %al,%al
 6e1:	0f 85 70 fe ff ff    	jne    557 <printf+0x22>
        putc(fd, c);
      }
      state = 0;
    }
  }
}
 6e7:	c9                   	leave  
 6e8:	c3                   	ret    
 6e9:	66 90                	xchg   %ax,%ax
 6eb:	90                   	nop

000006ec <free>:
static Header base;
static Header *freep;

void
free(void *ap)
{
 6ec:	55                   	push   %ebp
 6ed:	89 e5                	mov    %esp,%ebp
 6ef:	83 ec 10             	sub    $0x10,%esp
  Header *bp, *p;

  bp = (Header*)ap - 1;
 6f2:	8b 45 08             	mov    0x8(%ebp),%eax
 6f5:	83 e8 08             	sub    $0x8,%eax
 6f8:	89 45 f8             	mov    %eax,-0x8(%ebp)
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 6fb:	a1 68 14 00 00       	mov    0x1468,%eax
 700:	89 45 fc             	mov    %eax,-0x4(%ebp)
 703:	eb 24                	jmp    729 <free+0x3d>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
 705:	8b 45 fc             	mov    -0x4(%ebp),%eax
 708:	8b 00                	mov    (%eax),%eax
 70a:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 70d:	77 12                	ja     721 <free+0x35>
 70f:	8b 45 f8             	mov    -0x8(%ebp),%eax
 712:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 715:	77 24                	ja     73b <free+0x4f>
 717:	8b 45 fc             	mov    -0x4(%ebp),%eax
 71a:	8b 00                	mov    (%eax),%eax
 71c:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 71f:	77 1a                	ja     73b <free+0x4f>
free(void *ap)
{
  Header *bp, *p;

  bp = (Header*)ap - 1;
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 721:	8b 45 fc             	mov    -0x4(%ebp),%eax
 724:	8b 00                	mov    (%eax),%eax
 726:	89 45 fc             	mov    %eax,-0x4(%ebp)
 729:	8b 45 f8             	mov    -0x8(%ebp),%eax
 72c:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 72f:	76 d4                	jbe    705 <free+0x19>
 731:	8b 45 fc             	mov    -0x4(%ebp),%eax
 734:	8b 00                	mov    (%eax),%eax
 736:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 739:	76 ca                	jbe    705 <free+0x19>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
      break;
  if(bp + bp->s.size == p->s.ptr){
 73b:	8b 45 f8             	mov    -0x8(%ebp),%eax
 73e:	8b 40 04             	mov    0x4(%eax),%eax
 741:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
 748:	8b 45 f8             	mov    -0x8(%ebp),%eax
 74b:	01 c2                	add    %eax,%edx
 74d:	8b 45 fc             	mov    -0x4(%ebp),%eax
 750:	8b 00                	mov    (%eax),%eax
 752:	39 c2                	cmp    %eax,%edx
 754:	75 24                	jne    77a <free+0x8e>
    bp->s.size += p->s.ptr->s.size;
 756:	8b 45 f8             	mov    -0x8(%ebp),%eax
 759:	8b 50 04             	mov    0x4(%eax),%edx
 75c:	8b 45 fc             	mov    -0x4(%ebp),%eax
 75f:	8b 00                	mov    (%eax),%eax
 761:	8b 40 04             	mov    0x4(%eax),%eax
 764:	01 c2                	add    %eax,%edx
 766:	8b 45 f8             	mov    -0x8(%ebp),%eax
 769:	89 50 04             	mov    %edx,0x4(%eax)
    bp->s.ptr = p->s.ptr->s.ptr;
 76c:	8b 45 fc             	mov    -0x4(%ebp),%eax
 76f:	8b 00                	mov    (%eax),%eax
 771:	8b 10                	mov    (%eax),%edx
 773:	8b 45 f8             	mov    -0x8(%ebp),%eax
 776:	89 10                	mov    %edx,(%eax)
 778:	eb 0a                	jmp    784 <free+0x98>
  } else
    bp->s.ptr = p->s.ptr;
 77a:	8b 45 fc             	mov    -0x4(%ebp),%eax
 77d:	8b 10                	mov    (%eax),%edx
 77f:	8b 45 f8             	mov    -0x8(%ebp),%eax
 782:	89 10                	mov    %edx,(%eax)
  if(p + p->s.size == bp){
 784:	8b 45 fc             	mov    -0x4(%ebp),%eax
 787:	8b 40 04             	mov    0x4(%eax),%eax
 78a:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
 791:	8b 45 fc             	mov    -0x4(%ebp),%eax
 794:	01 d0                	add    %edx,%eax
 796:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 799:	75 20                	jne    7bb <free+0xcf>
    p->s.size += bp->s.size;
 79b:	8b 45 fc             	mov    -0x4(%ebp),%eax
 79e:	8b 50 04             	mov    0x4(%eax),%edx
 7a1:	8b 45 f8             	mov    -0x8(%ebp),%eax
 7a4:	8b 40 04             	mov    0x4(%eax),%eax
 7a7:	01 c2                	add    %eax,%edx
 7a9:	8b 45 fc             	mov    -0x4(%ebp),%eax
 7ac:	89 50 04             	mov    %edx,0x4(%eax)
    p->s.ptr = bp->s.ptr;
 7af:	8b 45 f8             	mov    -0x8(%ebp),%eax
 7b2:	8b 10                	mov    (%eax),%edx
 7b4:	8b 45 fc             	mov    -0x4(%ebp),%eax
 7b7:	89 10                	mov    %edx,(%eax)
 7b9:	eb 08                	jmp    7c3 <free+0xd7>
  } else
    p->s.ptr = bp;
 7bb:	8b 45 fc             	mov    -0x4(%ebp),%eax
 7be:	8b 55 f8             	mov    -0x8(%ebp),%edx
 7c1:	89 10                	mov    %edx,(%eax)
  freep = p;
 7c3:	8b 45 fc             	mov    -0x4(%ebp),%eax
 7c6:	a3 68 14 00 00       	mov    %eax,0x1468
}
 7cb:	c9                   	leave  
 7cc:	c3                   	ret    

000007cd <morecore>:

static Header*
morecore(uint nu)
{
 7cd:	55                   	push   %ebp
 7ce:	89 e5                	mov    %esp,%ebp
 7d0:	83 ec 28             	sub    $0x28,%esp
  char *p;
  Header *hp;

  if(nu < 4096)
 7d3:	81 7d 08 ff 0f 00 00 	cmpl   $0xfff,0x8(%ebp)
 7da:	77 07                	ja     7e3 <morecore+0x16>
    nu = 4096;
 7dc:	c7 45 08 00 10 00 00 	movl   $0x1000,0x8(%ebp)
  p = sbrk(nu * sizeof(Header));
 7e3:	8b 45 08             	mov    0x8(%ebp),%eax
 7e6:	c1 e0 03             	shl    $0x3,%eax
 7e9:	89 04 24             	mov    %eax,(%esp)
 7ec:	e8 2f fc ff ff       	call   420 <sbrk>
 7f1:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(p == (char*)-1)
 7f4:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
 7f8:	75 07                	jne    801 <morecore+0x34>
    return 0;
 7fa:	b8 00 00 00 00       	mov    $0x0,%eax
 7ff:	eb 22                	jmp    823 <morecore+0x56>
  hp = (Header*)p;
 801:	8b 45 f4             	mov    -0xc(%ebp),%eax
 804:	89 45 f0             	mov    %eax,-0x10(%ebp)
  hp->s.size = nu;
 807:	8b 45 f0             	mov    -0x10(%ebp),%eax
 80a:	8b 55 08             	mov    0x8(%ebp),%edx
 80d:	89 50 04             	mov    %edx,0x4(%eax)
  free((void*)(hp + 1));
 810:	8b 45 f0             	mov    -0x10(%ebp),%eax
 813:	83 c0 08             	add    $0x8,%eax
 816:	89 04 24             	mov    %eax,(%esp)
 819:	e8 ce fe ff ff       	call   6ec <free>
  return freep;
 81e:	a1 68 14 00 00       	mov    0x1468,%eax
}
 823:	c9                   	leave  
 824:	c3                   	ret    

00000825 <malloc>:

void*
malloc(uint nbytes)
{
 825:	55                   	push   %ebp
 826:	89 e5                	mov    %esp,%ebp
 828:	83 ec 28             	sub    $0x28,%esp
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
 82b:	8b 45 08             	mov    0x8(%ebp),%eax
 82e:	83 c0 07             	add    $0x7,%eax
 831:	c1 e8 03             	shr    $0x3,%eax
 834:	83 c0 01             	add    $0x1,%eax
 837:	89 45 ec             	mov    %eax,-0x14(%ebp)
  if((prevp = freep) == 0){
 83a:	a1 68 14 00 00       	mov    0x1468,%eax
 83f:	89 45 f0             	mov    %eax,-0x10(%ebp)
 842:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 846:	75 23                	jne    86b <malloc+0x46>
    base.s.ptr = freep = prevp = &base;
 848:	c7 45 f0 60 14 00 00 	movl   $0x1460,-0x10(%ebp)
 84f:	8b 45 f0             	mov    -0x10(%ebp),%eax
 852:	a3 68 14 00 00       	mov    %eax,0x1468
 857:	a1 68 14 00 00       	mov    0x1468,%eax
 85c:	a3 60 14 00 00       	mov    %eax,0x1460
    base.s.size = 0;
 861:	c7 05 64 14 00 00 00 	movl   $0x0,0x1464
 868:	00 00 00 
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 86b:	8b 45 f0             	mov    -0x10(%ebp),%eax
 86e:	8b 00                	mov    (%eax),%eax
 870:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if(p->s.size >= nunits){
 873:	8b 45 f4             	mov    -0xc(%ebp),%eax
 876:	8b 40 04             	mov    0x4(%eax),%eax
 879:	3b 45 ec             	cmp    -0x14(%ebp),%eax
 87c:	72 4d                	jb     8cb <malloc+0xa6>
      if(p->s.size == nunits)
 87e:	8b 45 f4             	mov    -0xc(%ebp),%eax
 881:	8b 40 04             	mov    0x4(%eax),%eax
 884:	3b 45 ec             	cmp    -0x14(%ebp),%eax
 887:	75 0c                	jne    895 <malloc+0x70>
        prevp->s.ptr = p->s.ptr;
 889:	8b 45 f4             	mov    -0xc(%ebp),%eax
 88c:	8b 10                	mov    (%eax),%edx
 88e:	8b 45 f0             	mov    -0x10(%ebp),%eax
 891:	89 10                	mov    %edx,(%eax)
 893:	eb 26                	jmp    8bb <malloc+0x96>
      else {
        p->s.size -= nunits;
 895:	8b 45 f4             	mov    -0xc(%ebp),%eax
 898:	8b 40 04             	mov    0x4(%eax),%eax
 89b:	89 c2                	mov    %eax,%edx
 89d:	2b 55 ec             	sub    -0x14(%ebp),%edx
 8a0:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8a3:	89 50 04             	mov    %edx,0x4(%eax)
        p += p->s.size;
 8a6:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8a9:	8b 40 04             	mov    0x4(%eax),%eax
 8ac:	c1 e0 03             	shl    $0x3,%eax
 8af:	01 45 f4             	add    %eax,-0xc(%ebp)
        p->s.size = nunits;
 8b2:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8b5:	8b 55 ec             	mov    -0x14(%ebp),%edx
 8b8:	89 50 04             	mov    %edx,0x4(%eax)
      }
      freep = prevp;
 8bb:	8b 45 f0             	mov    -0x10(%ebp),%eax
 8be:	a3 68 14 00 00       	mov    %eax,0x1468
      return (void*)(p + 1);
 8c3:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8c6:	83 c0 08             	add    $0x8,%eax
 8c9:	eb 38                	jmp    903 <malloc+0xde>
    }
    if(p == freep)
 8cb:	a1 68 14 00 00       	mov    0x1468,%eax
 8d0:	39 45 f4             	cmp    %eax,-0xc(%ebp)
 8d3:	75 1b                	jne    8f0 <malloc+0xcb>
      if((p = morecore(nunits)) == 0)
 8d5:	8b 45 ec             	mov    -0x14(%ebp),%eax
 8d8:	89 04 24             	mov    %eax,(%esp)
 8db:	e8 ed fe ff ff       	call   7cd <morecore>
 8e0:	89 45 f4             	mov    %eax,-0xc(%ebp)
 8e3:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 8e7:	75 07                	jne    8f0 <malloc+0xcb>
        return 0;
 8e9:	b8 00 00 00 00       	mov    $0x0,%eax
 8ee:	eb 13                	jmp    903 <malloc+0xde>
  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
  if((prevp = freep) == 0){
    base.s.ptr = freep = prevp = &base;
    base.s.size = 0;
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 8f0:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8f3:	89 45 f0             	mov    %eax,-0x10(%ebp)
 8f6:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8f9:	8b 00                	mov    (%eax),%eax
 8fb:	89 45 f4             	mov    %eax,-0xc(%ebp)
      return (void*)(p + 1);
    }
    if(p == freep)
      if((p = morecore(nunits)) == 0)
        return 0;
  }
 8fe:	e9 70 ff ff ff       	jmp    873 <malloc+0x4e>
}
 903:	c9                   	leave  
 904:	c3                   	ret    
 905:	66 90                	xchg   %ax,%ax
 907:	90                   	nop

00000908 <uthread_init>:
int c_thread = 0;

// task 2.2

void uthread_init()
{
 908:	55                   	push   %ebp
 909:	89 e5                	mov    %esp,%ebp
 90b:	83 ec 28             	sub    $0x28,%esp

	int i;
	ttable[0].tid = 0;
 90e:	c7 05 80 14 00 00 00 	movl   $0x0,0x1480
 915:	00 00 00 
	STORE_ESP(ttable[0].esp);
 918:	89 e0                	mov    %esp,%eax
 91a:	a3 84 14 00 00       	mov    %eax,0x1484
	STORE_EBP(ttable[0].ebp);
 91f:	89 e8                	mov    %ebp,%eax
 921:	a3 88 14 00 00       	mov    %eax,0x1488
	ttable[0].state = T_RUNNING;
 926:	c7 05 90 14 00 00 01 	movl   $0x1,0x1490
 92d:	00 00 00 
	ttable[0].wait_num = 0;
 930:	c7 05 94 15 00 00 00 	movl   $0x0,0x1594
 937:	00 00 00 
	//initialize all other slots to FREE and assign TIDs for future use
	for (i = 1; i < MAX_THREAD; i ++)
 93a:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
 941:	eb 2c                	jmp    96f <uthread_init+0x67>
	{
		ttable[i].tid = i;
 943:	8b 45 f4             	mov    -0xc(%ebp),%eax
 946:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 94c:	8d 90 80 14 00 00    	lea    0x1480(%eax),%edx
 952:	8b 45 f4             	mov    -0xc(%ebp),%eax
 955:	89 02                	mov    %eax,(%edx)
		ttable[i].state = T_FREE;
 957:	8b 45 f4             	mov    -0xc(%ebp),%eax
 95a:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 960:	05 90 14 00 00       	add    $0x1490,%eax
 965:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	STORE_ESP(ttable[0].esp);
	STORE_EBP(ttable[0].ebp);
	ttable[0].state = T_RUNNING;
	ttable[0].wait_num = 0;
	//initialize all other slots to FREE and assign TIDs for future use
	for (i = 1; i < MAX_THREAD; i ++)
 96b:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
 96f:	83 7d f4 3f          	cmpl   $0x3f,-0xc(%ebp)
 973:	7e ce                	jle    943 <uthread_init+0x3b>
	{
		ttable[i].tid = i;
		ttable[i].state = T_FREE;
	}
	signal(SIGALRM, uthread_yield);
 975:	c7 44 24 04 fb 0b 00 	movl   $0xbfb,0x4(%esp)
 97c:	00 
 97d:	c7 04 24 0e 00 00 00 	movl   $0xe,(%esp)
 984:	e8 af fa ff ff       	call   438 <signal>
	alarm(THREAD_QUANTA);
 989:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
 990:	e8 b3 fa ff ff       	call   448 <alarm>
}
 995:	c9                   	leave  
 996:	c3                   	ret    

00000997 <uthread_create>:

// task 2.3

int uthread_create(void (*start_func)(void *), void*arg)
{
 997:	55                   	push   %ebp
 998:	89 e5                	mov    %esp,%ebp
 99a:	83 ec 28             	sub    $0x28,%esp
	int i;
	int ticks;
	asm("pusha");
 99d:	60                   	pusha  
	ticks = getTicks();
 99e:	e8 ad fa ff ff       	call   450 <getTicks>
 9a3:	89 45 f0             	mov    %eax,-0x10(%ebp)
	alarm(0);
 9a6:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 9ad:	e8 96 fa ff ff       	call   448 <alarm>
	asm("popa");
 9b2:	61                   	popa   
	for (i = 0; i < MAX_THREAD; i++)
 9b3:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
 9ba:	e9 02 01 00 00       	jmp    ac1 <uthread_create+0x12a>
	{
		if (ttable[i].state == T_FREE)
 9bf:	8b 45 f4             	mov    -0xc(%ebp),%eax
 9c2:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 9c8:	05 90 14 00 00       	add    $0x1490,%eax
 9cd:	8b 00                	mov    (%eax),%eax
 9cf:	85 c0                	test   %eax,%eax
 9d1:	0f 85 e6 00 00 00    	jne    abd <uthread_create+0x126>
		{	
			//allocate a stack for the new thread
			if ((ttable[i].stack = malloc(STACK_SIZE)) < 0)
 9d7:	c7 04 24 00 10 00 00 	movl   $0x1000,(%esp)
 9de:	e8 42 fe ff ff       	call   825 <malloc>
 9e3:	8b 55 f4             	mov    -0xc(%ebp),%edx
 9e6:	69 d2 18 01 00 00    	imul   $0x118,%edx,%edx
 9ec:	81 c2 80 14 00 00    	add    $0x1480,%edx
 9f2:	89 42 0c             	mov    %eax,0xc(%edx)
			{
				alarm(ticks);
				return -1;
			}
			LOAD_ESP(ttable[i].stack + STACK_SIZE);
 9f5:	8b 45 f4             	mov    -0xc(%ebp),%eax
 9f8:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 9fe:	05 80 14 00 00       	add    $0x1480,%eax
 a03:	8b 40 0c             	mov    0xc(%eax),%eax
 a06:	05 00 10 00 00       	add    $0x1000,%eax
 a0b:	89 c4                	mov    %eax,%esp
			PUSH(arg);
 a0d:	8b 45 0c             	mov    0xc(%ebp),%eax
 a10:	89 c7                	mov    %eax,%edi
 a12:	57                   	push   %edi
			PUSH(uthread_exit);
 a13:	b8 81 0c 00 00       	mov    $0xc81,%eax
 a18:	89 c7                	mov    %eax,%edi
 a1a:	57                   	push   %edi
			PUSH(start_func);
 a1b:	8b 45 08             	mov    0x8(%ebp),%eax
 a1e:	89 c7                	mov    %eax,%edi
 a20:	57                   	push   %edi
			//added for the first "pop ebp"
			PUSH(0);
 a21:	b8 00 00 00 00       	mov    $0x0,%eax
 a26:	89 c7                	mov    %eax,%edi
 a28:	57                   	push   %edi
			STORE_ESP(ttable[i].ebp);
 a29:	89 e0                	mov    %esp,%eax
 a2b:	8b 55 f4             	mov    -0xc(%ebp),%edx
 a2e:	69 d2 18 01 00 00    	imul   $0x118,%edx,%edx
 a34:	81 c2 80 14 00 00    	add    $0x1480,%edx
 a3a:	89 42 08             	mov    %eax,0x8(%edx)
			ttable[i].esp = ttable[i].ebp;
 a3d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 a40:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 a46:	05 80 14 00 00       	add    $0x1480,%eax
 a4b:	8b 40 08             	mov    0x8(%eax),%eax
 a4e:	8b 55 f4             	mov    -0xc(%ebp),%edx
 a51:	69 d2 18 01 00 00    	imul   $0x118,%edx,%edx
 a57:	81 c2 80 14 00 00    	add    $0x1480,%edx
 a5d:	89 42 04             	mov    %eax,0x4(%edx)
			//set esp to current thread's esp
			LOAD_ESP(ttable[c_thread].esp);
 a60:	a1 6c 14 00 00       	mov    0x146c,%eax
 a65:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 a6b:	05 80 14 00 00       	add    $0x1480,%eax
 a70:	8b 40 04             	mov    0x4(%eax),%eax
 a73:	89 c4                	mov    %eax,%esp
			ttable[i].state = T_RUNNABLE;
 a75:	8b 45 f4             	mov    -0xc(%ebp),%eax
 a78:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 a7e:	05 90 14 00 00       	add    $0x1490,%eax
 a83:	c7 00 02 00 00 00    	movl   $0x2,(%eax)
			ttable[i].wait_num = 0;
 a89:	8b 45 f4             	mov    -0xc(%ebp),%eax
 a8c:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 a92:	05 90 15 00 00       	add    $0x1590,%eax
 a97:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
			asm("pusha");
 a9e:	60                   	pusha  
			alarm(ticks);
 a9f:	8b 45 f0             	mov    -0x10(%ebp),%eax
 aa2:	89 04 24             	mov    %eax,(%esp)
 aa5:	e8 9e f9 ff ff       	call   448 <alarm>
			asm("popa");
 aaa:	61                   	popa   
			return ttable[i].tid;
 aab:	8b 45 f4             	mov    -0xc(%ebp),%eax
 aae:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 ab4:	05 80 14 00 00       	add    $0x1480,%eax
 ab9:	8b 00                	mov    (%eax),%eax
 abb:	eb 1e                	jmp    adb <uthread_create+0x144>
	int ticks;
	asm("pusha");
	ticks = getTicks();
	alarm(0);
	asm("popa");
	for (i = 0; i < MAX_THREAD; i++)
 abd:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
 ac1:	83 7d f4 3f          	cmpl   $0x3f,-0xc(%ebp)
 ac5:	0f 8e f4 fe ff ff    	jle    9bf <uthread_create+0x28>
			asm("popa");
			return ttable[i].tid;
			
		}
	}
	alarm(ticks);
 acb:	8b 45 f0             	mov    -0x10(%ebp),%eax
 ace:	89 04 24             	mov    %eax,(%esp)
 ad1:	e8 72 f9 ff ff       	call   448 <alarm>
	//failed - no free thread to use
	return -1;
 ad6:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
 adb:	c9                   	leave  
 adc:	c3                   	ret    

00000add <safe_exit>:

// task 2.4


void safe_exit()
{
 add:	55                   	push   %ebp
 ade:	89 e5                	mov    %esp,%ebp
 ae0:	83 ec 28             	sub    $0x28,%esp
 ae3:	eb 01                	jmp    ae6 <safe_exit+0x9>
			}
		}
		if (tid == MAX_THREAD){
			exit();
		}
	}
 ae5:	90                   	nop
void safe_exit()
{
	int tid;
	while (1)
	{
		for (tid = 1; tid< MAX_THREAD; tid++)
 ae6:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
 aed:	eb 25                	jmp    b14 <safe_exit+0x37>
		{
			if (ttable[tid].state != T_FREE){
 aef:	8b 45 f4             	mov    -0xc(%ebp),%eax
 af2:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 af8:	05 90 14 00 00       	add    $0x1490,%eax
 afd:	8b 00                	mov    (%eax),%eax
 aff:	85 c0                	test   %eax,%eax
 b01:	74 0d                	je     b10 <safe_exit+0x33>
				uthread_join(tid);
 b03:	8b 45 f4             	mov    -0xc(%ebp),%eax
 b06:	89 04 24             	mov    %eax,(%esp)
 b09:	e8 1d 02 00 00       	call   d2b <uthread_join>
				break;
 b0e:	eb 0a                	jmp    b1a <safe_exit+0x3d>
void safe_exit()
{
	int tid;
	while (1)
	{
		for (tid = 1; tid< MAX_THREAD; tid++)
 b10:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
 b14:	83 7d f4 3f          	cmpl   $0x3f,-0xc(%ebp)
 b18:	7e d5                	jle    aef <safe_exit+0x12>
			if (ttable[tid].state != T_FREE){
				uthread_join(tid);
				break;
			}
		}
		if (tid == MAX_THREAD){
 b1a:	83 7d f4 40          	cmpl   $0x40,-0xc(%ebp)
 b1e:	75 c5                	jne    ae5 <safe_exit+0x8>
			exit();
 b20:	e8 73 f8 ff ff       	call   398 <exit>

00000b25 <uthread_switch>:
		}
	}
}

void uthread_switch()
{
 b25:	55                   	push   %ebp
 b26:	89 e5                	mov    %esp,%ebp
 b28:	83 ec 28             	sub    $0x28,%esp
	int i;
	int n_thread = (c_thread + 1) % MAX_THREAD;
 b2b:	a1 6c 14 00 00       	mov    0x146c,%eax
 b30:	8d 50 01             	lea    0x1(%eax),%edx
 b33:	89 d0                	mov    %edx,%eax
 b35:	c1 f8 1f             	sar    $0x1f,%eax
 b38:	c1 e8 1a             	shr    $0x1a,%eax
 b3b:	01 c2                	add    %eax,%edx
 b3d:	83 e2 3f             	and    $0x3f,%edx
 b40:	89 d1                	mov    %edx,%ecx
 b42:	29 c1                	sub    %eax,%ecx
 b44:	89 c8                	mov    %ecx,%eax
 b46:	89 45 f0             	mov    %eax,-0x10(%ebp)

	//finding a runnable thread
	for (i = 0; ttable[n_thread].state != T_RUNNABLE && i < MAX_THREAD; i++)
 b49:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
 b50:	eb 20                	jmp    b72 <uthread_switch+0x4d>
	{
		n_thread = (n_thread + 1) % MAX_THREAD;
 b52:	8b 45 f0             	mov    -0x10(%ebp),%eax
 b55:	8d 50 01             	lea    0x1(%eax),%edx
 b58:	89 d0                	mov    %edx,%eax
 b5a:	c1 f8 1f             	sar    $0x1f,%eax
 b5d:	c1 e8 1a             	shr    $0x1a,%eax
 b60:	01 c2                	add    %eax,%edx
 b62:	83 e2 3f             	and    $0x3f,%edx
 b65:	89 d1                	mov    %edx,%ecx
 b67:	29 c1                	sub    %eax,%ecx
 b69:	89 c8                	mov    %ecx,%eax
 b6b:	89 45 f0             	mov    %eax,-0x10(%ebp)
{
	int i;
	int n_thread = (c_thread + 1) % MAX_THREAD;

	//finding a runnable thread
	for (i = 0; ttable[n_thread].state != T_RUNNABLE && i < MAX_THREAD; i++)
 b6e:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
 b72:	8b 45 f0             	mov    -0x10(%ebp),%eax
 b75:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 b7b:	05 90 14 00 00       	add    $0x1490,%eax
 b80:	8b 00                	mov    (%eax),%eax
 b82:	83 f8 02             	cmp    $0x2,%eax
 b85:	74 06                	je     b8d <uthread_switch+0x68>
 b87:	83 7d f4 3f          	cmpl   $0x3f,-0xc(%ebp)
 b8b:	7e c5                	jle    b52 <uthread_switch+0x2d>
	{
		n_thread = (n_thread + 1) % MAX_THREAD;
	}
	STORE_ESP(ttable[c_thread].esp);
 b8d:	8b 15 6c 14 00 00    	mov    0x146c,%edx
 b93:	89 e0                	mov    %esp,%eax
 b95:	69 d2 18 01 00 00    	imul   $0x118,%edx,%edx
 b9b:	81 c2 80 14 00 00    	add    $0x1480,%edx
 ba1:	89 42 04             	mov    %eax,0x4(%edx)
	STORE_EBP(ttable[c_thread].ebp);
 ba4:	8b 15 6c 14 00 00    	mov    0x146c,%edx
 baa:	89 e8                	mov    %ebp,%eax
 bac:	69 d2 18 01 00 00    	imul   $0x118,%edx,%edx
 bb2:	81 c2 80 14 00 00    	add    $0x1480,%edx
 bb8:	89 42 08             	mov    %eax,0x8(%edx)
	c_thread = n_thread;
 bbb:	8b 45 f0             	mov    -0x10(%ebp),%eax
 bbe:	a3 6c 14 00 00       	mov    %eax,0x146c
	LOAD_EBP(ttable[c_thread].ebp);
 bc3:	a1 6c 14 00 00       	mov    0x146c,%eax
 bc8:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 bce:	05 80 14 00 00       	add    $0x1480,%eax
 bd3:	8b 40 08             	mov    0x8(%eax),%eax
 bd6:	89 c5                	mov    %eax,%ebp
	LOAD_ESP(ttable[c_thread].esp);
 bd8:	a1 6c 14 00 00       	mov    0x146c,%eax
 bdd:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 be3:	05 80 14 00 00       	add    $0x1480,%eax
 be8:	8b 40 04             	mov    0x4(%eax),%eax
 beb:	89 c4                	mov    %eax,%esp
	alarm(THREAD_QUANTA);
 bed:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
 bf4:	e8 4f f8 ff ff       	call   448 <alarm>
}
 bf9:	c9                   	leave  
 bfa:	c3                   	ret    

00000bfb <uthread_yield>:

void uthread_yield()
{
 bfb:	55                   	push   %ebp
 bfc:	89 e5                	mov    %esp,%ebp
 bfe:	83 ec 18             	sub    $0x18,%esp
	//store registers on stack
	asm("pusha");
 c01:	60                   	pusha  
	alarm(0);
 c02:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 c09:	e8 3a f8 ff ff       	call   448 <alarm>
	ttable[c_thread].state = T_RUNNABLE;
 c0e:	a1 6c 14 00 00       	mov    0x146c,%eax
 c13:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 c19:	05 90 14 00 00       	add    $0x1490,%eax
 c1e:	c7 00 02 00 00 00    	movl   $0x2,(%eax)
	//change current thread
	uthread_switch();
 c24:	e8 fc fe ff ff       	call   b25 <uthread_switch>
	asm("popa");
 c29:	61                   	popa   
}
 c2a:	c9                   	leave  
 c2b:	c3                   	ret    

00000c2c <uthread_awake>:

// task 2.5

void uthread_awake()
{
 c2c:	55                   	push   %ebp
 c2d:	89 e5                	mov    %esp,%ebp
 c2f:	83 ec 10             	sub    $0x10,%esp
	int i;
	for (i = 0; i < ttable[c_thread].wait_num; i++)
 c32:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
 c39:	eb 2c                	jmp    c67 <uthread_awake+0x3b>
		ttable[ttable[c_thread].waiting[i]].state = T_RUNNABLE;
 c3b:	a1 6c 14 00 00       	mov    0x146c,%eax
 c40:	6b d0 46             	imul   $0x46,%eax,%edx
 c43:	8b 45 fc             	mov    -0x4(%ebp),%eax
 c46:	01 d0                	add    %edx,%eax
 c48:	83 c0 04             	add    $0x4,%eax
 c4b:	8b 04 85 84 14 00 00 	mov    0x1484(,%eax,4),%eax
 c52:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 c58:	05 90 14 00 00       	add    $0x1490,%eax
 c5d:	c7 00 02 00 00 00    	movl   $0x2,(%eax)
// task 2.5

void uthread_awake()
{
	int i;
	for (i = 0; i < ttable[c_thread].wait_num; i++)
 c63:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 c67:	a1 6c 14 00 00       	mov    0x146c,%eax
 c6c:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 c72:	05 90 15 00 00       	add    $0x1590,%eax
 c77:	8b 40 04             	mov    0x4(%eax),%eax
 c7a:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 c7d:	7f bc                	jg     c3b <uthread_awake+0xf>
		ttable[ttable[c_thread].waiting[i]].state = T_RUNNABLE;
}
 c7f:	c9                   	leave  
 c80:	c3                   	ret    

00000c81 <uthread_exit>:

void uthread_exit()
{
 c81:	55                   	push   %ebp
 c82:	89 e5                	mov    %esp,%ebp
 c84:	83 ec 18             	sub    $0x18,%esp
	asm("pusha");
 c87:	60                   	pusha  
	alarm(0);
 c88:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 c8f:	e8 b4 f7 ff ff       	call   448 <alarm>
	asm("popa");
 c94:	61                   	popa   
	ttable[c_thread].state = T_FREE;
 c95:	a1 6c 14 00 00       	mov    0x146c,%eax
 c9a:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 ca0:	05 90 14 00 00       	add    $0x1490,%eax
 ca5:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	if (ttable[c_thread].tid != 0)
 cab:	a1 6c 14 00 00       	mov    0x146c,%eax
 cb0:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 cb6:	05 80 14 00 00       	add    $0x1480,%eax
 cbb:	8b 00                	mov    (%eax),%eax
 cbd:	85 c0                	test   %eax,%eax
 cbf:	74 1d                	je     cde <uthread_exit+0x5d>
		free(ttable[c_thread].stack);
 cc1:	a1 6c 14 00 00       	mov    0x146c,%eax
 cc6:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 ccc:	05 80 14 00 00       	add    $0x1480,%eax
 cd1:	8b 40 0c             	mov    0xc(%eax),%eax
 cd4:	89 04 24             	mov    %eax,(%esp)
 cd7:	e8 10 fa ff ff       	call   6ec <free>
 cdc:	eb 05                	jmp    ce3 <uthread_exit+0x62>
	else
		safe_exit();
 cde:	e8 fa fd ff ff       	call   add <safe_exit>
	uthread_awake();
 ce3:	e8 44 ff ff ff       	call   c2c <uthread_awake>
	uthread_switch();
 ce8:	e8 38 fe ff ff       	call   b25 <uthread_switch>
	asm("popa");
 ced:	61                   	popa   
}
 cee:	c9                   	leave  
 cef:	c3                   	ret    

00000cf0 <uthread_self>:

// task 2.6

int uthread_self()
{
 cf0:	55                   	push   %ebp
 cf1:	89 e5                	mov    %esp,%ebp
	return c_thread;
 cf3:	a1 6c 14 00 00       	mov    0x146c,%eax
}
 cf8:	5d                   	pop    %ebp
 cf9:	c3                   	ret    

00000cfa <uthread_sleep>:

// task 2.7

void uthread_sleep()
{
 cfa:	55                   	push   %ebp
 cfb:	89 e5                	mov    %esp,%ebp
 cfd:	83 ec 18             	sub    $0x18,%esp
	asm("pusha");
 d00:	60                   	pusha  
	alarm(0);
 d01:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 d08:	e8 3b f7 ff ff       	call   448 <alarm>
	ttable[c_thread].state = T_SLEEPING;
 d0d:	a1 6c 14 00 00       	mov    0x146c,%eax
 d12:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 d18:	05 90 14 00 00       	add    $0x1490,%eax
 d1d:	c7 00 03 00 00 00    	movl   $0x3,(%eax)
	uthread_switch();
 d23:	e8 fd fd ff ff       	call   b25 <uthread_switch>
	asm("popa");
 d28:	61                   	popa   
}
 d29:	c9                   	leave  
 d2a:	c3                   	ret    

00000d2b <uthread_join>:

int uthread_join(int tid)
{
 d2b:	55                   	push   %ebp
 d2c:	89 e5                	mov    %esp,%ebp
 d2e:	53                   	push   %ebx
 d2f:	83 ec 24             	sub    $0x24,%esp

	int ticks;
	asm("pusha");
 d32:	60                   	pusha  
	ticks = getTicks();
 d33:	e8 18 f7 ff ff       	call   450 <getTicks>
 d38:	89 45 f4             	mov    %eax,-0xc(%ebp)
	alarm(0);
 d3b:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 d42:	e8 01 f7 ff ff       	call   448 <alarm>
	asm("popa");
 d47:	61                   	popa   
	if (ttable[tid].state != T_FREE)
 d48:	8b 45 08             	mov    0x8(%ebp),%eax
 d4b:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 d51:	05 90 14 00 00       	add    $0x1490,%eax
 d56:	8b 00                	mov    (%eax),%eax
 d58:	85 c0                	test   %eax,%eax
 d5a:	74 5e                	je     dba <uthread_join+0x8f>
	{
		//adding current thread to tid waiting list and going to sleep.
		ttable[tid].waiting[ttable[tid].wait_num++] = ttable[c_thread].tid;
 d5c:	8b 45 08             	mov    0x8(%ebp),%eax
 d5f:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 d65:	05 10 01 00 00       	add    $0x110,%eax
 d6a:	05 80 14 00 00       	add    $0x1480,%eax
 d6f:	8d 48 04             	lea    0x4(%eax),%ecx
 d72:	8b 45 08             	mov    0x8(%ebp),%eax
 d75:	69 c0 18 01 00 00    	imul   $0x118,%eax,%eax
 d7b:	05 90 15 00 00       	add    $0x1590,%eax
 d80:	8b 40 04             	mov    0x4(%eax),%eax
 d83:	8b 15 6c 14 00 00    	mov    0x146c,%edx
 d89:	69 d2 18 01 00 00    	imul   $0x118,%edx,%edx
 d8f:	81 c2 80 14 00 00    	add    $0x1480,%edx
 d95:	8b 12                	mov    (%edx),%edx
 d97:	8b 5d 08             	mov    0x8(%ebp),%ebx
 d9a:	6b db 46             	imul   $0x46,%ebx,%ebx
 d9d:	01 c3                	add    %eax,%ebx
 d9f:	83 c3 04             	add    $0x4,%ebx
 da2:	89 14 9d 84 14 00 00 	mov    %edx,0x1484(,%ebx,4)
 da9:	83 c0 01             	add    $0x1,%eax
 dac:	89 01                	mov    %eax,(%ecx)
		uthread_sleep();
 dae:	e8 47 ff ff ff       	call   cfa <uthread_sleep>
		return 0;
 db3:	b8 00 00 00 00       	mov    $0x0,%eax
 db8:	eb 12                	jmp    dcc <uthread_join+0xa1>
	}
	asm("pusha");
 dba:	60                   	pusha  
	alarm(ticks);
 dbb:	8b 45 f4             	mov    -0xc(%ebp),%eax
 dbe:	89 04 24             	mov    %eax,(%esp)
 dc1:	e8 82 f6 ff ff       	call   448 <alarm>
	asm("popa");
 dc6:	61                   	popa   
	return -1;
 dc7:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
 dcc:	83 c4 24             	add    $0x24,%esp
 dcf:	5b                   	pop    %ebx
 dd0:	5d                   	pop    %ebp
 dd1:	c3                   	ret    

00000dd2 <queue_init>:

void queue_init(struct tqueue *q)
{
 dd2:	55                   	push   %ebp
 dd3:	89 e5                	mov    %esp,%ebp
	q->head = 0;
 dd5:	8b 45 08             	mov    0x8(%ebp),%eax
 dd8:	c7 80 00 01 00 00 00 	movl   $0x0,0x100(%eax)
 ddf:	00 00 00 
	q->tail = 0;
 de2:	8b 45 08             	mov    0x8(%ebp),%eax
 de5:	c7 80 04 01 00 00 00 	movl   $0x0,0x104(%eax)
 dec:	00 00 00 
}
 def:	5d                   	pop    %ebp
 df0:	c3                   	ret    

00000df1 <dequeue>:

struct uthread* dequeue(struct binary_semaphore* semaphore)
{
 df1:	55                   	push   %ebp
 df2:	89 e5                	mov    %esp,%ebp
 df4:	57                   	push   %edi
 df5:	56                   	push   %esi
 df6:	53                   	push   %ebx
	if (semaphore->queue->head == semaphore->queue->tail)
 df7:	8b 45 08             	mov    0x8(%ebp),%eax
 dfa:	8b 00                	mov    (%eax),%eax
 dfc:	8b 90 00 01 00 00    	mov    0x100(%eax),%edx
 e02:	8b 45 08             	mov    0x8(%ebp),%eax
 e05:	8b 00                	mov    (%eax),%eax
 e07:	8b 80 04 01 00 00    	mov    0x104(%eax),%eax
 e0d:	39 c2                	cmp    %eax,%edx
 e0f:	75 07                	jne    e18 <dequeue+0x27>
		return 0;
 e11:	b9 00 00 00 00       	mov    $0x0,%ecx
 e16:	eb 31                	jmp    e49 <dequeue+0x58>
	return semaphore->queue->uthreads[semaphore->queue->tail++ % MAX_THREAD];
 e18:	8b 45 08             	mov    0x8(%ebp),%eax
 e1b:	8b 18                	mov    (%eax),%ebx
 e1d:	8b 45 08             	mov    0x8(%ebp),%eax
 e20:	8b 10                	mov    (%eax),%edx
 e22:	8b 82 04 01 00 00    	mov    0x104(%edx),%eax
 e28:	89 c1                	mov    %eax,%ecx
 e2a:	c1 f9 1f             	sar    $0x1f,%ecx
 e2d:	c1 e9 1a             	shr    $0x1a,%ecx
 e30:	8d 34 08             	lea    (%eax,%ecx,1),%esi
 e33:	83 e6 3f             	and    $0x3f,%esi
 e36:	89 f7                	mov    %esi,%edi
 e38:	29 cf                	sub    %ecx,%edi
 e3a:	89 f9                	mov    %edi,%ecx
 e3c:	8b 0c 8b             	mov    (%ebx,%ecx,4),%ecx
 e3f:	83 c0 01             	add    $0x1,%eax
 e42:	89 82 04 01 00 00    	mov    %eax,0x104(%edx)
 e48:	90                   	nop
 e49:	89 c8                	mov    %ecx,%eax
}
 e4b:	5b                   	pop    %ebx
 e4c:	5e                   	pop    %esi
 e4d:	5f                   	pop    %edi
 e4e:	5d                   	pop    %ebp
 e4f:	c3                   	ret    

00000e50 <enqueue>:

void enqueue(struct binary_semaphore* semaphore)
{
 e50:	55                   	push   %ebp
 e51:	89 e5                	mov    %esp,%ebp
 e53:	57                   	push   %edi
 e54:	56                   	push   %esi
 e55:	53                   	push   %ebx
	semaphore->queue->uthreads[semaphore->queue->head++ % MAX_THREAD] = &ttable[c_thread];
 e56:	8b 45 08             	mov    0x8(%ebp),%eax
 e59:	8b 18                	mov    (%eax),%ebx
 e5b:	8b 45 08             	mov    0x8(%ebp),%eax
 e5e:	8b 10                	mov    (%eax),%edx
 e60:	8b 82 00 01 00 00    	mov    0x100(%edx),%eax
 e66:	89 c1                	mov    %eax,%ecx
 e68:	c1 f9 1f             	sar    $0x1f,%ecx
 e6b:	c1 e9 1a             	shr    $0x1a,%ecx
 e6e:	8d 34 08             	lea    (%eax,%ecx,1),%esi
 e71:	83 e6 3f             	and    $0x3f,%esi
 e74:	89 f7                	mov    %esi,%edi
 e76:	29 cf                	sub    %ecx,%edi
 e78:	89 f9                	mov    %edi,%ecx
 e7a:	8b 35 6c 14 00 00    	mov    0x146c,%esi
 e80:	69 f6 18 01 00 00    	imul   $0x118,%esi,%esi
 e86:	81 c6 80 14 00 00    	add    $0x1480,%esi
 e8c:	89 34 8b             	mov    %esi,(%ebx,%ecx,4)
 e8f:	83 c0 01             	add    $0x1,%eax
 e92:	89 82 00 01 00 00    	mov    %eax,0x100(%edx)
}
 e98:	5b                   	pop    %ebx
 e99:	5e                   	pop    %esi
 e9a:	5f                   	pop    %edi
 e9b:	5d                   	pop    %ebp
 e9c:	c3                   	ret    

00000e9d <binary_semaphore_init>:

void binary_semaphore_init(struct binary_semaphore* semaphore, int value)
{
 e9d:	55                   	push   %ebp
 e9e:	89 e5                	mov    %esp,%ebp
 ea0:	83 ec 18             	sub    $0x18,%esp
	semaphore->queue = malloc(sizeof(struct tqueue));
 ea3:	c7 04 24 08 01 00 00 	movl   $0x108,(%esp)
 eaa:	e8 76 f9 ff ff       	call   825 <malloc>
 eaf:	8b 55 08             	mov    0x8(%ebp),%edx
 eb2:	89 02                	mov    %eax,(%edx)
	if (!value)
 eb4:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
 eb8:	75 0c                	jne    ec6 <binary_semaphore_init+0x29>
		semaphore->state = S_LOCKED;
 eba:	8b 45 08             	mov    0x8(%ebp),%eax
 ebd:	c7 40 04 01 00 00 00 	movl   $0x1,0x4(%eax)
 ec4:	eb 0a                	jmp    ed0 <binary_semaphore_init+0x33>
	else
		semaphore->state = S_FREE;
 ec6:	8b 45 08             	mov    0x8(%ebp),%eax
 ec9:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
}
 ed0:	c9                   	leave  
 ed1:	c3                   	ret    

00000ed2 <binary_semaphore_down>:
void binary_semaphore_down(struct binary_semaphore* semaphore)
{
 ed2:	55                   	push   %ebp
 ed3:	89 e5                	mov    %esp,%ebp
 ed5:	83 ec 28             	sub    $0x28,%esp
	//store amount of ticks left and prevent scheduler from switching
	int ticks;
	asm("pusha");
 ed8:	60                   	pusha  
	ticks = getTicks();
 ed9:	e8 72 f5 ff ff       	call   450 <getTicks>
 ede:	89 45 f4             	mov    %eax,-0xc(%ebp)
	alarm(0);
 ee1:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 ee8:	e8 5b f5 ff ff       	call   448 <alarm>
	asm("popa");
 eed:	61                   	popa   
	if (semaphore->state == S_LOCKED)
 eee:	8b 45 08             	mov    0x8(%ebp),%eax
 ef1:	8b 40 04             	mov    0x4(%eax),%eax
 ef4:	83 f8 01             	cmp    $0x1,%eax
 ef7:	75 1c                	jne    f15 <binary_semaphore_down+0x43>
	{
		enqueue(semaphore);
 ef9:	8b 45 08             	mov    0x8(%ebp),%eax
 efc:	89 04 24             	mov    %eax,(%esp)
 eff:	e8 4c ff ff ff       	call   e50 <enqueue>
		uthread_sleep();
 f04:	e8 f1 fd ff ff       	call   cfa <uthread_sleep>
		alarm(0);
 f09:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 f10:	e8 33 f5 ff ff       	call   448 <alarm>
	}
	semaphore->state = S_LOCKED;
 f15:	8b 45 08             	mov    0x8(%ebp),%eax
 f18:	c7 40 04 01 00 00 00 	movl   $0x1,0x4(%eax)
	//allow the thread to run its remaining time
	alarm(ticks);
 f1f:	8b 45 f4             	mov    -0xc(%ebp),%eax
 f22:	89 04 24             	mov    %eax,(%esp)
 f25:	e8 1e f5 ff ff       	call   448 <alarm>

}
 f2a:	c9                   	leave  
 f2b:	c3                   	ret    

00000f2c <binary_semaphore_up>:
void binary_semaphore_up(struct binary_semaphore* semaphore)
{
 f2c:	55                   	push   %ebp
 f2d:	89 e5                	mov    %esp,%ebp
 f2f:	83 ec 28             	sub    $0x28,%esp
	int ticks;
	struct uthread *next;
	asm("pusha");
 f32:	60                   	pusha  
	ticks = getTicks();
 f33:	e8 18 f5 ff ff       	call   450 <getTicks>
 f38:	89 45 f4             	mov    %eax,-0xc(%ebp)
	alarm(0);
 f3b:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 f42:	e8 01 f5 ff ff       	call   448 <alarm>
	asm("popa");
 f47:	61                   	popa   


	if ((next = dequeue(semaphore)) == 0)
 f48:	8b 45 08             	mov    0x8(%ebp),%eax
 f4b:	89 04 24             	mov    %eax,(%esp)
 f4e:	e8 9e fe ff ff       	call   df1 <dequeue>
 f53:	89 45 f0             	mov    %eax,-0x10(%ebp)
 f56:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 f5a:	75 19                	jne    f75 <binary_semaphore_up+0x49>
	{
		//no thread is waiting. release semaphore and restore alarm
		semaphore->state = S_FREE;
 f5c:	8b 45 08             	mov    0x8(%ebp),%eax
 f5f:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
		asm("pusha");
 f66:	60                   	pusha  
		alarm(ticks);
 f67:	8b 45 f4             	mov    -0xc(%ebp),%eax
 f6a:	89 04 24             	mov    %eax,(%esp)
 f6d:	e8 d6 f4 ff ff       	call   448 <alarm>
		asm("popa");
 f72:	61                   	popa   
 f73:	eb 0f                	jmp    f84 <binary_semaphore_up+0x58>
	}
	else
	{
		//threads are waiting. wake up the next thread and yield.
		next->state = T_RUNNABLE;
 f75:	8b 45 f0             	mov    -0x10(%ebp),%eax
 f78:	c7 40 10 02 00 00 00 	movl   $0x2,0x10(%eax)
		uthread_yield();
 f7f:	e8 77 fc ff ff       	call   bfb <uthread_yield>
	}
}
 f84:	c9                   	leave  
 f85:	c3                   	ret    
